
public class Main {

	public static void main(String[] args) {
		
		String pserialized = "geometry.Point;String:6:Point1;double:1.0;double:2.0;";
		Point p = (Point) Point.deserialize(pserialized);
		System.out.println("x=" + p.getX() + ",y=" + p.getY() +", name=" + p.getName());
		
		String sserialized = "geometry.Segment;Point:geometry.Point;String:6:Point1;double:1.0;double:2.0;Point:geometry.Point;String:6:Point2;double:2.0;double:3.0;String:8:Segment1;";
		Segment s = (Segment) Segment.deserialize(sserialized);
		System.out.println(s);
	}
}
